package com.zdyt.opc.config;


import org.jinterop.dcom.common.JIException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.net.UnknownHostException;


@Configuration
@EnableConfigurationProperties(OpcProperties.class)
public class OpcAutoConfiguration {

    private static Logger logger = LoggerFactory.getLogger(OpcAutoConfiguration.class);

    private final OpcProperties opcProperties;


    public OpcAutoConfiguration(OpcProperties opcProperties) {
        this.opcProperties = opcProperties;
    }



    // 注入OpcClient
    @Bean
    public OpcOperation opcOperation(OpcProperties opcProperties) throws JIException, UnknownHostException {
        return new OpcOperation(opcProperties);
    }


}
